/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package manager;

import entity.User;
import iface.IManagerDisabled;
import java.util.ArrayList;

/**
 *
 * @author Noi
 */
public class DisabledUserManager implements IManagerDisabled<User> {
    
    private Manager manager;
    private ArrayList<User> alUser;
    
    public DisabledUserManager(Manager manager) {
        this.manager = manager;
        this.alUser = new ArrayList<User>();
    }
    
    @Override
    public void add(User obj) {
        this.alUser.add(obj);
    }

    @Override
    public void recovery(int index) {
        User user = (User)this.alUser.remove(index);
        user.setStatus(true);
        this.manager.getUserManager().add(user);
    }

    @Override
    public User get(int index) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
}
